<ul>
    <?php foreach($menu as $r){?>
        <li><a href="<?=PATH_URL.$r->url?>" <?php if($this->uri->segment(1)==$r->url){?> class="active" <?php }else{?> class="" <?php }?>><?=$r->title?></a>
        	<?php if($r->url=='san-pham'){?> 
            <ul>
            <?php foreach($category as $v){?>                       	
                <li><a href="<?=PATH_URL.$r->url.'/danh-muc/'.$v->id?>"><?=$v->title?></a></li>
            <?php } ?>
            </ul>
            <?php } ?>
        </li>
    <?php }?>
</ul>